package cn.com.Kol.ITPMP.TenMajorAreas.model;

import cn.com.Kol.ITPMP.System.Area;
import cn.com.Kol.ITPMP.System.Process;

import static cn.com.Kol.ITPMP.System.Constants.*;


public class QualityManagement extends Area {

    private Process MakeQualityManagementPlan = new Process(MAKE_QUALITY_MANAGEMENT_PLAN);
    private Process QualityAssurance= new Process(QUALITY_ASSURANCE);
    private Process QualityControl = new Process(QUALITY_CONTROL);

    private void QualityManagementProcess(){
        CreateProcess(MakeQualityManagementPlan);
        CreateProcess(QualityAssurance);
        CreateProcess(QualityControl);
    }

    public void SetInputs(Process process){
        switch (process.getProcessName()){
            case "规划质量管理":
                process.inputs(PROJECT_MANAGEMENT_PLAN);
                process.inputs(STAKEHOLDER_REGISTER);
                process.inputs(RISK_REGISTER);
                process.inputs(REQUIREMENTS_DOCUMENTATION);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "质量保证":
                process.inputs(QUALITY_MANAGEMENT_PLAN);
                process.inputs(PROCESS_IMPROVEMENT_PLAN);
                process.inputs(QUALITY_MEASURE_METRICS);
                process.inputs(QUALITY_CONTROL_MEASUREMENT_RESULTS);
                process.inputs(PROJECT_FILE);
                break;
            case "质量控制":
                process.inputs(PROJECT_MANAGEMENT_PLAN);
                process.inputs(QUALITY_MEASURE_METRICS);
                process.inputs(QUALITY_CHECK_LIST);
                process.inputs(WORK_PERFORMANCE_DATA);
                process.inputs(APPROVED_CHANGE_REQUESTS);
                process.inputs(DELIVERABLE);
                process.inputs(PROJECT_FILE);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
        }
    }

    public void UseToolAndTech(Process process){
        switch (process.getProcessName()){
            case "规划质量管理":
                process.useToolAndTech(COST_BENEFIT_ANALYSIS);
                process.useToolAndTech(QUALITY_COSTS);
                process.useToolAndTech(SEVEN_BASIC_QUALITY_TOOLS);
                process.useToolAndTech(BENCHMARKING);
                process.useToolAndTech(EXPERIMENTAL_DESIGN);
                process.useToolAndTech(STATISTICAL_SAMPLING);
                process.useToolAndTech(OTHER_QUALITY_MANAGEMENT_TOOLS);
                process.useToolAndTech(CONFERENCE);
                break;
            case "质量保证":
                process.useToolAndTech(QUALITY_MANAGEMENT_AND_CONTROL_TOOLS);
                process.useToolAndTech(QUALITY_AUDIT);
                process.useToolAndTech(PROCESS_ANALYSIS);
                break;
            case "质量控制":
                process.useToolAndTech(SEVEN_BASIC_QUALITY_TOOLS);
                process.useToolAndTech(STATISTICAL_SAMPLING);
                process.useToolAndTech(CHECK);
                process.useToolAndTech(AUDIT_APPROVED_CHANGE_REQUESTS);
                break;
        }
    }

    public void SetOutputs(Process process){
        switch (process.getProcessName()){
            case "规划质量管理":
                process.outputs(QUALITY_MANAGEMENT_PLAN);
                process.outputs(PROCESS_IMPROVEMENT_PLAN);
                process.outputs(QUALITY_MEASURE_METRICS);
                process.outputs(QUALITY_CHECK_LIST);
                process.outputs(PROJECT_FILE_UPDATE);
                break;
            case "质量保证":
                process.outputs(CHANGE_REQUESTS);
                process.outputs(PROJECT_MANAGEMENT_PLAN_UPDATE);
                process.outputs(PROJECT_FILE_UPDATE);
                process.outputs(ORGANIZATIONAL_PROCESS_ASSETS_UPDATE);
                break;
            case "质量控制":
                process.outputs(QUALITY_CONTROL_MEASUREMENT_RESULTS);
                process.outputs(CONFIRMED_CHANGES);
                process.outputs(VERIFIED_DELIVERABLES);
                process.outputs(WORK_PERFORMANCE_INFO);
                process.outputs(CHANGE_REQUESTS);
                process.outputs(PROJECT_MANAGEMENT_PLAN_UPDATE);
                process.outputs(PROJECT_FILE_UPDATE);
                process.outputs(ORGANIZATIONAL_PROCESS_ASSETS_UPDATE);
                break;
        }

    }
}
